


var Animal = function (arg_name, arg_family, arg_specie, arg_legs, arg_wings, arg_fly,x){
    
//    console.log(arguments);
    if(typeof x=="undefined");
    console.log("hello bitch x");
    
    var _name = name;
    
    var family = arg_family;
    
    this.family = function () {
        console.log("The %s belongs to the family of the %ss", name, family);
    };
    
    var specie = arg_specie;
    
    this.specie = function() {
        console.log("The %s belongs to the specie of the %s", name, specie);
    };
    
    var legs = arg_legs;
    
    this.legs = function() {
        console.log("The %s has %n legs", name, legs)
    };
    
    
    
    var wings = arg_wings;
    var fly = arg_fly;
    
    this.wings = function(arg_dist) {
        
        var dist = arg_dist
        
        if (wings == true) {
                                
            if(fly == true) {
                          
                if(dist >0) {
                    console.log("The %s has wings and it can fly distances up to %n meters", name, dist)
                }
                else {
                    console.log("The %s has wings and it can fly", name)
                }
            }
            else {
                console.log("The %s has wings, but it can't fly", name)
            }
        }
        else {
            console.log("The %s doesn't have wings", name)
        }
    }
        
    this.resume = function (arg_dist){
        
        var dist = arg_dist
        
        if (wings == true){
            if(fly == true) {
                
                if(dist >0) {
                    console.log("The %s is a %s animal, from the specie of the %s and it has %n legs. It also has wings, so it can fly long distances up to %n meters", name, family, specie, legs, dist )
                }
                else {
                    console.log("The %s is a %s animal, from the specie of the %s and it has %n legs. It also has wings, so it can fly", name, family, specie, legs)
                }
            }
            else {
                console.log("The %s is a %s animal, from the specie of the %s and it has %n legs. It also has wings, but it can't fly", name, family, specie, legs )
            }
        }
        else {
                console.log("The %s is a %s animal, from the specie of the %s and it has %n legs. It's land animal, so it doesn't have wings", name, family, specie, legs )
        }
    } ;
}


var dog = new Animal ("dog", "mammal", "canis lupus", 4);
var pigeon = new Animal ("pigeon", "bird", "Columbidae", 2, true, true);
var penguin = new Animal ("penguin", "bird", "Spheniscidae", 2, true, false, "amx");



dog.family();
dog.specie();
dog.legs();


dog.wings(200);

penguin.wings(200);
pigeon.wings(200);

penguin.resume();
pigeon.resume();
pigeon.resume(200);
dog.resume();
